﻿using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Solution.Application.Workers
{
    public class LogWorker : BackgroundService
    {
        private readonly ILogger<LogWorker> _logger;

        public LogWorker(ILogger<LogWorker> logger)
        {
            _logger = logger;
        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            await WriteTextLog();
        }

        private async Task WriteTextLog()
        {
            _logger.LogInformation("test nlog");
            await Task.CompletedTask;
        }
    }
}